package com.smart.nacos.consumer.controller;

import com.smart.nacos.consumer.api.ProviderApi;
import com.smart.nacos.consumer.reqeuest.UserReqeust;
import com.smart.nacos.consumer.service.FeignConsumerService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 方式方法
 */
@RestController
public class ConsumerController {
    @Resource
    FeignConsumerService feignConsumerService;
    @Resource
    ProviderApi providerApi;

    @GetMapping("/hello")
    public String test() {
        return feignConsumerService.hello();
    }


    @GetMapping("/test1")
    public String test1(String msg) {
        return providerApi.msg(msg);
    }

    @GetMapping("/test2")
    public String test2(UserReqeust userReqeust) {
        return providerApi.obj(userReqeust);
    }

    @GetMapping("/test3")
    public String test3(UserReqeust userReqeust) {
        return providerApi.json(userReqeust);
    }

    @GetMapping("/test4")
    public String test4() {
        return feignConsumerService.hello();
    }

    @GetMapping("/test5")
    public String test5() {
        return feignConsumerService.hello();
    }
}
